<template>
  <div class="photoinfo">
    <h3>{{photoinfo.title}}</h3>
    <p class="subtitle">
      <span>发表时间：{{photoinfo.time | dataFormat}}</span>
      <span>点击：{{photoinfo.click}}次</span>
    </p>

    <hr />

    <!-- 缩略图区域 -->

    <div class="thumbs">
        <vue-preview :slides="slide1" class="hah"></vue-preview>
    </div>

    <!-- 图片内容区域 -->
    <div class="content" v-html="photoinfo.content"></div>

    <!-- 放置现成的评论子组件 -->
    <cmt-box :id="id"></cmt-box>
  </div>
</template>

<script>
import comment from "../subcomponents/comment.vue";

export default {
  data() {
    return {
      id: this.$route.params.i,
      photoinfo: {
        title: "图片详细",
        time: new Date(),
        click: 0,
        content: "<p>这是图片的详细内容，由于不知道内容是什么，所以就瞎几把写了！！！</p>"
      },
      slide1: [
        {
          src:
            "https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_b.jpg",
          msrc:
            "https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_m.jpg",
          alt: "picture1",
          title: "Image Caption 1",
          w: 600,
          h: 400
        },
        {
          src:
            "https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_b.jpg",
          msrc:
            "https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_m.jpg",
          alt: "picture2",
          title: "Image Caption 2",
          w: 1200,
          h: 900
        },
        {
          src:
            "https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_b.jpg",
          msrc:
            "https://farm6.staticflickr.com/5591/15008867125_68a8ed88cc_m.jpg",
          alt: "picture3",
          title: "Image Caption 3",
          w: 600,
          h: 400
        },
        {
          src:
            "https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_b.jpg",
          msrc:
            "https://farm4.staticflickr.com/3902/14985871946_86abb8c56f_m.jpg",
          alt: "picture4",
          title: "Image Caption 4",
          w: 1200,
          h: 900
        },
      ]
    };
  },
  methods: {
  },
  components: {
    "cmt-box": comment
  }
};
</script>

<style scoped>
.photoinfo {
  padding: 3px;
}
h3 {
  color: #26a2ff;
  font-size: 15px;
  text-align: center;
  margin: 15px 0;
}
.subtitle {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.content {
  font-size: 13px;
  line-height: 30px;
}

</style>